Field of the Invention
The present invention relates to a numerical control apparatus, and particularly to a numerical control apparatus capable of screen update even at the time of a heavy load.
Description of the Related Art
A numerical control apparatus is intended to control the motion of a motor for high-precision, high-speed processing in which a desired shape is obtained. The motion control includes a task of analyzing a machining program and a task of creating interpolation data for driving the motor on the basis of a result of the analysis, and high priority is given to these tasks among a plurality of tasks. For example, in five-axis machining of a shape of three-dimensional sculptured surface that is formed of continuous minute blocks and requires heavy-CPU-load operation, the CPU is very busy with the task of analyzing the program and the task of creating interpolation data, and a large amount of time is allocated for the tasks. As a result, the amounts of time allocated for other tasks to which low priorities are given decrease.
In some numerical control apparatus, a control apparatus main body that performs the motion control and an HMI (human machine interface) that is means for information communication between an operator and the numerical control apparatus are run by different CPUs. In this case, the HMI usually operates as an application on a general-purpose OS. The control apparatus main body has an application interface apparatus for data communication with an external apparatus, and the application interface apparatus is typically called an API. The HMI performs data communication with the control apparatus main body via the API. Since the specification of an API is open to the public, a machine tool builder can create, as an application on a general-purpose OS, a proprietary HMI according to a machine manufactured by the machine tool builder.
Since the HMI is run by a CPU different from a CPU that runs the control apparatus main body, time allocated for an HMI-related task does not decrease even in heavy-CPU-load operation. On the basis of a request from an API invoked by the HMI, the control apparatus main body executes a process of preparing data to be displayed on the screen of the HMI or any other process. Priority given to the task of preparing the data is lower than priority given to the motion control task. When heavy-CPU-load operation is performed, it affects and shortens time allocated for the task of preparing the data. As a result, it takes a longer time for the API to return a response.
In addition to a numerical control apparatus, when the load on a CPU increases in a PC and a variety of control apparatus, it takes a long time to update the screen and respond to manual operation in some cases. Such a state is stressful to the operator. The operator then feels uneasy because the operator is not sure whether the PC or the apparatus is operating normally or is hung up or whether, in the case of a numerical control apparatus, machining is being normally performed.
To avoid such a situation, in heavy-CPU-load operation, a technology for reducing the amount of data displayed on the screen so that the frequency of screen update does not lower has been proposed.
For example, Japanese Patent Laid-open No. 2009-204477 proposes a technology for simplifying information displayed on the screen in heavy-CPU-load operation to lower the frequency of screen update for a decrease in processing period in a car navigation device. Japanese Patent Laid-open No. 2009-217713, which relates to a robot control system formed of a control apparatus main body and a portable manual operation section that is an HMI, proposes a technology for handling a situation in which the CPU in the portable manual operation section is operating under a heavy load by reducing the amount of image data transferred from the control apparatus main body to reduce the burden on the portable manual operation section for prevention of degradation in screen update and operability. In both the technologies of related art, the amount of data to be processed is reduced to reduce the burden on the HMI for prevention of deterioration of screen display and operability.
In a numerical control apparatus in which the control apparatus main body and the HMI are run by different CPUs, an operation-related CPU load influences the processing time of the API. The degree of the influence of the CPU load on the API varies API to API. That is, an API is greatly influenced, whereas another API is hardly influenced. In a case where an API greatly influenced by heavy-CPU-load operation is invoked by the HMI, it takes a long time to complete the process. Since an API typically returns no response until a required process is completed, the HMI cannot execute the following process during the invocation. Further, when the process cannot be completed in a predetermined period, the API returns a timeout error and the process is aborted. Also in this case, the following process cannot be executed until the API returns the timeout error. Since the following process cannot be executed, the screen update is delayed during the invocation, and the operator cannot therefore manually operate the HMI in the meantime but is forced to wait. Further, since even when the API returns a timeout error and the process is aborted, no cause of the timeout error is notified, and the HMI cannot therefore evaluate whether the timeout error occurred due to heavy-load operation.
FIG. 4 shows an example of the flowchart of screen display. The screen display process has a loop structure, and monitoring of an event (step SA01) and acquisition of data to be displayed on the screen/update of the displayed data (steps SA05 to SA07) are sequentially performed. When a screen update event (step SA04) is received, the screen is updated, and when a screen switching event (step SA02) is received, the control leaves the loop of the currently displayed screen, and a screen switching process (step SA03) is executed.
In the display process illustrated in the flowchart shown in FIG. 4, data 1 to data N are displayed on the screen. In a case where at least one of APIs for acquiring the data 1 to data N is influenced by an operation-related load and it therefore takes time to invoke the API, the screen is not updated during the invocation irrespective of successful invocation or a timeout error. Further, since no event can be monitored during the invocation, the screen cannot be switched even when a screen switching request is received.
In contrast, each of Japanese Patent Laid-open No. 2009-204477 and Japanese Patent Laid-open No. 2009-217713 is a technology for reducing the amount of data to be handled to lower the load on the CPU in the HMI for continuous screen update and therefore considers no CPU load on the data preparation side, which means that each of them does not solve the problem described above.